#include<stdio.h>
int main()
{
	int i, n, boy = 0, girl = 0;
	int a[10000];
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%d", &a[i]);
		if (a[i] == 0)boy += 1;
		else girl += 1;
	}
	printf("%d %d\n", boy, girl);
	return 0;
}